{template header}
<script type="text/javascript">
window.onload=function ()
{
    message = '{$message}';
    if(message != '')
    {
        alert(message);
    }
}
function addVipUser ()
{
    user = $("#vipUserId").val();
    if(user != '')
    {
        $.ajax({url:"index.php?c=admin&a=addVipUser&user=" + user,
            async:false,
            dataType:"json",
            error:function(){
                // alert('未知错误');
                },
            success:function(data, status){
                turnData = eval(data);
                alert(turnData.message);
                if(turnData.err == 0)
                {
                    window.location.href = "index.php?c=admin&a=supermanList\n";
                }
            }
        });
    }
    else
    {
        alert('请输入VIP用户ID或昵称');
    }
}
</script>
<div class="bs-docs-example ptb-20" style="clear:both;">
添加一个VIP用户：<input name="user" placeholder="请输入VIP用户ID或昵称" id="vipUserId">
<button class="btn" onclick="addVipUser()">确定</button>
</div>
<div class="bs-docs-example table-align" style="clear:both;">
    <table class="table table-striped">
        <thead>
            <tr>
                <th>头像</th>
                <th>教练昵称</th>
                <th>教练ID</th>
                <th>认证日期</th>
                <th>身高</th>
                <th>体重</th>
                <th>性别</th>
                <th>年龄</th>
                <th>里程</th>
                <th>次数</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {loop $userData $k $v}
            <tr>
                <td>
                    <a href="#header_{$k}" data-toggle="modal">
                        <image src="{$v['header']}" width="30" height="30">
                    </a>
                </td>
                <div id="header_{$k}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                        <h3 id="myModalLabel">头像大图</h3>
                    </div>
                    <div class="modal-body" style="height:700px;">
                        <img src="{$v['header']}">
                    </div>
                </div>
                <td><a class="btn btn-link" href="?c=admin&a=userinfo&uid=$v['uid']" target="_blank">{$v['nickname']}</a>
                </td>
                <td>{$v['uid']}</td>
                <td>{eval echo date('Y-m-d H:i:s', $v['addtime'])}</td>
                <td>{$v['height']}</td>
                <td>{$v['weight']}</td>
                <td>{if $v['gender'] == 1}男{elseif $v['gender'] == 2}女{else}保密{/if}</td>
                <td>{eval echo $v['age'] > 100 ? (2014 - $v['age']):$v['age']}岁</td>
                <td>{$v['total_mileage']}</td>
                <td>{$v['total_rate']}</td>
                <td><a class="btn btn-danger" href="?c=admin&a=delVipUser&uid=$v['uid']" onclick="return confirm('Are you sure?')">移除</a>
                </td>
            </tr>
            {/loop}
        </tbody>
    </table>
</div>
{template footer}
